﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.Util;
using Com.CMS263.PO;
using Com.CMS263.BLL;
using System.IO;

namespace Com.CMS263.Web.manage.GuestManage
{
    public partial class study_add : System.Web.UI.Page
    {
        StudentStudyBLL sibll = new StudentStudyBLL();
        public int id = 0;
        public int page = 0;
        public int stuid = 0;
        public int stupage = 0;
        public StudentStudy sinfo = new StudentStudy();
        public StudentInfo s = new StudentInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
           
            stuid = Convert.ToInt32(Request["stuid"]);
            stupage = Convert.ToInt32(Request["stupage"]);
            StudentInfoBLL sbll = new StudentInfoBLL();
            s = (StudentInfo)sbll.FindModelById("StudentInfo", stuid);
            
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {

            StudentStudy si = new StudentStudy();
            si.StudentInfoId = s.Id;
            si.RealName = s.RealName;
            si.AddDate = Convert.ToDateTime(Request["AddDate"]);
            si.One = StringUtil.checkStr(Request["One"]);
            si.Two = StringUtil.checkStr(Request["Two"]);
            si.Three = StringUtil.checkStr(Request["Three"]);
            si.Four = StringUtil.checkStr(Request["Four"]);
            si.Five = StringUtil.checkStr(Request["Five"]);
            si.Six = StringUtil.checkStr(Request["Six"]);
            si.Seven = StringUtil.checkStr(Request["Seven"]);
            si.Eight = StringUtil.checkStr(Request["Eight"]);
            si.Night = StringUtil.checkStr(Request["Night"]);
            
            sibll.entity = si;
            if (sibll.Add())
            {
                StringUtil.Alert("添加成功", "study_list.aspx?stuid="+stuid+"&stupage="+stupage);
            }


        }
        
    }
}
